<%@page contentType="text/html; UTF-8" pageEncoding="UTF-8" isELIgnored="false" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>用户管理</h1>
<p><a href="${pageContext.request.contextPath}/sys/user/logout">退出登录</a></p>
<ul>
    <table>
        <thead>
        <tr>
            <td>名称</td>
            <td>操作</td>
        </tr>
        </thead>
        <tbody>
        <c:forEach var="item" items="${userList}">
            <tr>
                <td>${item.username}</td>
                <td>
                    <shiro:hasPermission name="sys:user:view">
                        <a href="${pageContext.request.contextPath}/sys/user/view?id=${item.id}">用户查看</a>
                    </shiro:hasPermission>
                    <shiro:hasPermission name="sys:user:update">
                        <a href="${pageContext.request.contextPath}/sys/user/update">用户修改</a>
                    </shiro:hasPermission>
                    <shiro:hasPermission name="sys:user:delete">
                        <a href="${pageContext.request.contextPath}/sys/user/delete?id=${item.id}">用户删除</a>
                    </shiro:hasPermission>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</ul>
</body>
</html>